﻿@model LeEdu.MODEL.Group

@{
    ViewBag.Title = "HuaTiCreate";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<div id="content-container" class="container">

    <div class="group-header">
        <div class="group-header-inner" style="background: url(http://localhost:5130/Img/@Model.GBACKGROUND); background-repeat: no-repeat; background-size: 100% 100%;">
            <div class="media">
                <div class="media-left">
                    <a href="/Group/GroupHomepage/@Model.GroupID">
                        <img src="http://localhost:5130/Img/@Model.GLOGO" alt="@Model.GNAME" class="avatar-square-sm">
                    </a>
                </div>
                <div class="media-body">
                    <h2 class="media-heading">@Model.GNAME</h2>
                    <div class="media-metas">
                        @((Model.UserAndGroup).Count) 个成员
                    </div>
                </div>
            </div>
        </div>
    </div>
    <style>
        .ke-icon-hidden {
            background-image: url('/assets/img/default/iconfont-hide.png?6.9.6');
            background-position: center;
            width: 16px;
            height: 16px;
        }

        .ke-icon-accessory {
            background-image: url('/assets/img/default/iconfont-accessory.png');
            background-position: center;
            width: 16px;
            height: 16px;
        }

        .ke-icon-accessory-red {
            background-image: url('/assets/img/default/iconfont-accessory-red.png');
            background-position: center;
            width: 16px;
            height: 16px;
        }
    </style>
    <div class="panel panel-default">
        <div class="panel-heading">
            <strong>发表话题</strong>
        </div>
        <div class="panel-body">
            <form data-widget-cid="widget-0" novalidate="novalidate" id="user-thread-form" class="form-horizontal thread-form" method="post" action="/Group/HuaTiCreate">
                <input type="hidden" name="GroupID" value="@Model.GroupID" />
                <div class="form-group">
                    <label class="col-xs-2 control-label" for="thread_title">标题</label>
                    <div class="col-xs-7 controls">
                        <input data-explain="" data-widget-cid="widget-1" id="thread_title" name="HTITLE" class="form-control" value="" type="text">
                        <div class="help-block" style="display:none;"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label" for="thread_content">内容</label>

                    <div class="col-xs-7 controls">
                        @*<script id="container" name="HCONTENT" type="text/plain">
                        </script>*@
                        <textarea id="container" name="HCONTENT"></textarea>
                        </div>

                    <div class="col-xs-7 controls">
                        @*<textarea id="HCONTENT" rows="2" name="HCONTENT" cols="20"></textarea>
                        <input id="HCONTENT" type="text" name="HCONTENT" />
                        <script id="container" name="HCONTENT" type="text/plain"></script>*@

                    <div class="col-xs-7 controls  container-fluid">
                        @*<script id="container" name="INCONTENT" type="text/plain">
                        </script>*@
                        </div>

                        <script type="text/javascript">
                            var editor = UE.getEditor('container')
                        </script>
                        @*<div class="help-block" style="display:none;"></div>*@
                    </div>
                


                <div class="row">
                    <div class="col-xs-4 col-xs-offset-2">
                        <button id="groupthread-save-btn" data-submiting-text="正在创建" type="submit" class="btn btn-primary">发布</button>
                    </div>
                </div>

                <input name="_csrf_token" value="aff51995493c0ceeb9ddca78818419c55223e2b5" type="hidden">
                <input name="files" type="hidden">
            </form>

        </div>
    </div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="myModalLabel">插入隐藏内容</h4>
                </div>
                <div class="modal-body">

                    <form class="form-horizontal" method="post">
                        <div class="row form-group">
                            <div class="col-md-4 control">
                                <label class="control-label"> 请输入要隐藏的内容:</label>
                            </div>
                            <div class="col-md-7 controls">
                                <textarea class="form-control" rows="3" id="text"> </textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="controls">
                                <div class="col-md-4 control">
                                    <input id="type0" name="type" required="required" value="coin" checked="true" type="radio">
                                    <label for="amount" class="control-label"> 查看所需乐币:</label>
                                </div>
                                <div class="col-md-3 controls">
                                    <input name="amount" class="form-control" tyoe="text" id="amount">
                                </div>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-4 control">
                                <input id="type1" name="type" required="required" value="reply" type="radio">
                                <label for="amount" class="control-label"> 回复话题后可见</label>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <div class="pull-left text-muted">
                        隐藏话题获得的乐币会在扣除50%之后添加到您的账户
                    </div>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" id="insert">插入</button>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="myModalLabel">上传附件</h4>
                </div>
                <div class="modal-body">
                    <button class="btn btn-default btn-sm upload-img" style="height:33px;" type="button" data-url="/group/thread/upload?group=user">上传</button>
                    <span> (大小不能超过<span style="color:red;">2</span>MB，文件类型支持png ,jpg ,gif ,doc ,xls ,txt ,rar ,zip .)</span>
                    <table id="block-table" class="table table-striped table-condensed mtl">
                        <tbody>
                            
                            <tr>
                                <th width="60%">文件名</th>
                                <th>描述</th>
                                <th>乐币</th>
                                <th>操作</th>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <div class="pull-left text-muted">
                        用户下载附件扣除的乐币会在扣除50%之后添加到您的账户
                    </div>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" id="sure">确定</button>
                </div>
            </div>
        </div>
    </div>
</div>

 <script src="~/kindeditor（文本域）/kindeditor-min.js"></script>
                    <script type="text/javascript">
    KindEditor.ready(function (K) {
        var editor = K.create('#container', {
            //上传管理
            uploadJson: 'kindeditor/asp.net/upload_json.ashx',
            //文件管理
            fileManagerJson: 'kindeditor/asp.net/file_manager_json.ashx',
            allowFileManager: true,
            //设置编辑器创建后执行的回调函数
            afterCreate: function () {
                var self = this;
                K.ctrl(document, 13, function () {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function () {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            },
            //上传文件后执行的回调函数,获取上传图片的路径
            afterUpload: function (url) {
                alert(url);
            },
            //编辑器高度
            width: '100px',
            //编辑器宽度
            height: '200px;',
            //配置编辑器的工具栏
            items: [
            'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
            'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
            'anchor', 'link', 'unlink', '|', 'about'
            ]
        });
        prettyPrint();
    });
                    </script>